<?php
namespace app\property\controller;
use app\property\controller\Base;
class WageCard extends Base{
    public function index(){
        //分配日期
        $date = input('date')?input('date'):date("Y/m/d");
        $this->assign("date",$date);
        
        //userid
        $user = getSession("user","property_");
        $userid = $user['userid'];
        $this->assign("user",$user);
        
        $workwages = db()->table("view_wy_workwage")->where(['userid'=>$userid,'date'=>$date])->select();
        
        $restwages = db()->table("view_wy_restwage")->where(['userid'=>$userid,'date'=>$date])->select();
        
        $wage = db()->table("view_wy_wage")->where(['userid'=>$userid,'date'=>$date])->find();
        
        $this->assign("workwages",$workwages);
        $this->assign("restwages",$restwages);
        $this->assign("wage",$wage);
        
        return $this->fetch();
    }
}